
#ifndef GMACHINE_HEADER_GOBJECTS_H
#define	GMACHINE_HEADER_GOBJECTS_H

#include "Configure.h"
namespace GMachine
{
	///////////////////////////////////////////////////////////////
	// sized type.
	///////////////////////////////////////////////////////////////
	typedef unsigned char		U8;
	typedef unsigned short		U16;
	typedef unsigned int		U32;
	typedef unsigned long long	U64;
	
	///////////////////////////////////////////////////////////////
	// Internal storage type
	///////////////////////////////////////////////////////////////
	typedef void *
		HandleObject;

	typedef int 
		IntegerObject;

	typedef double
		FloatingObject;

	typedef struct { void * data; unsigned int size; }
		StringObject;


	struct ObjectTag
	{
		enum { GOBJ = 0, HOBJ = 1, FOBJ = 2, SOBJ = 3 };
		unsigned name:	2;
		unsigned count:	6;
		union {
			HandleObject *		hobjs;
			IntegerObject *		gobjs;
			FloatingObject *	fobjs;
			StringObject *		sobjs;
		};
	};




	///////////////////////////////////////////////////////////////
	// Generic type
	///////////////////////////////////////////////////////////////
	struct CellObject
	{
		CellObject(U8 name, void * data): cellname(name), celldata(data) {}
		void *	celldata;
		U8		cellname;
		U8		reserved1;
		U16		reserved2;
	};


	struct ObjectBox
	{
		
	};

	///////////////////////////////////////////////////////////////
	// Internal constant value
	///////////////////////////////////////////////////////////////
	const HandleObject NullHandle = 0;
	const StringObject NullString = {0, 0};

}

#endif	//ifndef GMACHINE_HEADER_GOBJECTS_H

